package com.net.xpay.operator.secutiry;

import com.net.xpay.common.domain.operator.OperatorUser;
import com.net.xpay.common.enums.user.ClientFrom;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.authentication.AbstractAuthenticationToken;

/**
 * @author  on 2018/9/12.
 */
@Getter
@Setter
public class AutoLoginToken extends AbstractAuthenticationToken {
    private OperatorUser operatorUser;

    private ClientFrom clientFrom;

    AutoLoginToken(OperatorUser operatorUser, ClientFrom clientFrom) {
        super(null);
        this.operatorUser = operatorUser;
        this.clientFrom = clientFrom;
    }

    @Override
    public Object getCredentials() {
        return operatorUser.getId();
    }

    @Override
    public Object getPrincipal() {
        return "";
    }
}
